package org.xxpay.pay.channel.sufpay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * @description: 速付支付
 */
@Component
public class SufpayConfig {

    public static final String CHANNEL_NAME = "sufpay"; //渠道名称
    public final static String CHANNEL_ALIPAY_H5 = CHANNEL_NAME + "_aliwap";	    //sufpay 通道的aliwap支付
    public final static String CHANNEL_ALIPAY_QR = CHANNEL_NAME + "_aliqrcode";	    //sufpay 通道的aliqrcode支付

    private String mchId; // 商户ID

    private String key;  // 商户Key

    private String reqUrlHost;  // 请求地址域名

    public SufpayConfig(){}

    public SufpayConfig(String payParam) {
        Assert.notNull(payParam, "init xxpay config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.mchId = object.getString("mchId");
        this.key = object.getString("key");
        this.reqUrlHost = object.getString("reqUrlHost");
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getReqUrlHost() {
        return reqUrlHost;
    }

    public void setReqUrlHost(String reqUrlHost) {
        this.reqUrlHost = reqUrlHost;
    }

}
